SpatialStream® Code Examples

Publish With Group By

Using the Publish, Postal Code Boundaries, GetMap, SLD, and Legend SpatialStream® components, an application programmer can create multiple dynamic trend maps that are geographic aggregations of a single point data set, and that are optimized for high performance over the web. This example will demonstrate the output of a Publish process that groups the source data by postal code and property type and assigns the min, max, average, sum and record count to the postal code boundary. The data set is then tied to the Postal Code Boundary data set from the SpatialStream® Content Library using the postal code as the key between the two datasets.

Using this approach many different data layers can be created and kept up to date from a single base layer. Below is the layer definition and the steps and services to use when Publishing a data set.

Layer Definitions used in this Publish Example

Postal Code Boundaries | Publish | GetMap | Legend | SLD

var publish = new Dmp.Layer.WMSLayer("boundary", "SS", {
antiAlias: true
});
publish.addChild("publishBoundary", "DMP_LICENSE/LAAVERAGEPRICESOLD", "$(ACCOUNT_FOLDER)SLD/PUBLISHEXAMPLE.sld.xml", {
zoomRange: {
min: 5, max: 19
}
});
publish.addChild("publishBoundaryL", "DMP_LICENSE/LAAVERAGEPRICESOLD", "$(ACCOUNT_FOLDER)SLD/PUBLISHEXAMPLELabel.sld.xml", {
zoomRange: {
min: 10, max: 19
}
});
map.addLayer(publish);

//----------------

var baseUrl = Dmp.Env.Connections["SS"].getBaseUrl();
var imgObj = document.getElementById("legend");
imgObj.src = baseUrl + "legend.aspx?&layer=DMP_LICENSE/LAAVERAGEPRICESOLD&SLD=$(ACCOUNT_FOLDER)SLD/PUBLISHEXAMPLE.sld.xml&headers=0";


Run Sample   View Video   Back To Index